<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnFromProjectToProjectInOrderTaskUpstreamVersionTable extends AbstractMigration
{
    public function up()
    {
        $this->table('order_task_upstream_version')
            ->addColumn('from_project_id', 'integer', [
                'limit' => 11,
                'null' => false,
                'default' => 0,
                'comment' => '上传的项目id',
            ])
            ->addColumn('to_project_id', 'integer', [
                'limit' => 11,
                'null' => false,
                'default' => 0,
                'comment' => '下载的项目id',
            ])
            ->addColumn('entity_id', 'integer', [
                'limit' => 11,
                'null' => false,
                'default' => 0,
                'comment' => '实体id',
            ])
            ->save();
    }

    public function down()
    {
        $this->table('order_task_upstream_version')
            ->removeColumn('from_project_id')
            ->removeColumn('to_project_id')
            ->removeColumn('entity_id')
            ->save();
    }
}
